<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>对象方法扩展</title>
	</head>
	<body>
		<script>
			// 1. Object.is 判断两个值是否相等
			console.log(Object.is(11,11));
			console.log(Object.is(NaN,NaN));
			console.log(NaN === NaN);
			// 2. Object.assign 对象的合并
			const config1 = {
				host:'localhost',
				port:3306,
				name:'root',
				pass:'root',
				test:'tttttt'
			};
			const config2 = {
				host:'127.0.0.1',
				port:3307,
				name:'admin',
				pass:'admin',
				test2:'xxxxxx'
			};
			console.log(Object.assign(config1,config2));
			// 3. Object.setPrototypeOf 设置原型对象 Object.getPrototypeOf
			const city = {name : 'hangzhou'};
			const area = {mc:['西湖','拱墅','上城','滨江','萧山']};
			Object.setPrototypeOf(city,area);
			console.log(Object.getPrototypeOf(city));
			console.log(city);
		</script>
	</body>
</html>